﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IsmsExplorer.Infrastructure.DomainBase;

namespace IsmsExplorer.Model.Iso27001 {
    public abstract class Iso27001ControlBase : EntityBase, IComparable {
        #region Data
        private string _referenceID;
        private string _name;
        #endregion

        #region Construction
        public Iso27001ControlBase(int id, string referenceID, string name)
            : base(id) {
            this.ReferenceID = referenceID;
            this.Name = name;
        }
        #endregion

        public string Name {
            get { return _name; }
            protected set { _name = value; }
        }

        public string ReferenceID {
            get { return _referenceID; }
            protected set { _referenceID = value; }
        }

        #region IComparable implementation

        public int CompareTo(object obj) {
            Iso27001ControlBase other = obj as Iso27001ControlBase;
            if (other != null) {
                return Math.Sign(this.ID - other.ID);

            } else {
                throw new ArgumentException("object to compare with is not Iso27001ControlBase");
            }
        }

        #endregion

    } // end public abstract class Iso27001ControlBase : EntityBase
}
